package config

/**
viper配置写入全局变量
通过global类读取所有配置
*/
type Configuration struct {
	App      app      `mapstructure:"app" json:"app" yaml:"app"`
	Log      log      `mapstructure:"log" json:"log" yaml:"log"`
	Database database `mapstructure:"database" json:"database" yaml:"database"`
	Redis    redis    `mapstructure:"redis" json:"redis" yaml:"redis"`
	// Jwt Jwt `mapstructure:"jwt" json:"jwt" yaml:"jwt"`
	// Storage Storage `mapstructure:"storage" json:"storage" yaml:"storage"`
}

var (
	Config   = new(Configuration)
	App      = new(app)
	Database = new(database)
	Redis    = new(redis)
	Log      = new(log)
)

// 短语处理
func Phrase() {
	App = &Config.App
	Database = &Config.Database
	Redis = &Config.Redis
	Log = &Config.Log
}
